var t = getApp();

Page({
    data: {
        active: 0,
        member: {},
        recordsList: [],
        page: 1,
        current_page: 1,
        last_page: 1
    },
    onLoad: function(t) {
        this.getData(), wx.setNavigationBarTitle({
            title: "见点奖励"
        });
        var a = wx.getStorageSync("langIndex");
        this.setData({
            language: a.en
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        this.data.current_page >= this.data.last_page || (this.setData({
            page: this.data.page + 1
        }), this.moreGetData());
    },
    onShareAppMessage: function() {},
    getData: function() {
        var a = this, e = t.getNetAddresss("plugin.find-point-reward.frontend.controllers.center");
        t._postNetWork({
            url: e,
            data: {
                page: this.data.page
            },
            success: function(t) {
                var e = t.data;
                1 == e.result ? a.setData({
                    member: e.data.info,
                    recordsList: e.data.list.data,
                    current_page: e.data.list.current_page,
                    last_page: e.data.list.last_page
                }) : wx.showToast({
                    title: e.msg,
                    icon: "none",
                    duration: 1e3
                });
            },
            fail: function(t) {}
        });
    },
    moreGetData: function() {
        var a = this, e = t.getNetAddresss("plugin.find-point-reward.frontend.controllers.center");
        t._postNetWork({
            url: e,
            data: {
                page: this.data.page
            },
            success: function(t) {
                var e = t.data;
                if (1 == e.result) {
                    var n = a.data.recordsList.concat(e.data.list.data);
                    a.setData({
                        recordsList: n,
                        current_page: e.data.list.current_page,
                        last_page: e.data.list.last_page
                    });
                } else wx.showToast({
                    title: e.msg,
                    icon: "none",
                    duration: 1e3
                });
            },
            fail: function(t) {}
        });
    }
});